package com.tanhua.manager.controller;

import com.tanhua.domain.db.AnalysisByDay;
import com.tanhua.manager.service.AnalysisService;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dashboard")
public class DashboardController {

    @Autowired
    private AnalysisService analysisService;

    @GetMapping(value = "/summary",name = "首页的统计")
    public ResponseEntity summary(){
        String todayStr = new DateTime().toString("yyyy-MM-dd");
        return analysisService.summary(todayStr);
    }

}
